<template>
    <LayLayer v-model="modelValue" title="false" type="dialog" :area="area">
        <slot v-if="modelValue"></slot>
    </LayLayer>
</template>

<script setup lang="ts">
import { LayLayer } from '@layui/layer-vue';
import { computed } from 'vue';
import type { DialogSchema } from 'aoe';

// noinspection JSUnusedGlobalSymbols
export interface DialogEmits {
    open: [];
    close: [];
}

const props = defineProps<DialogSchema>();
const modelValue = defineModel<boolean>();

const area = computed(() => [props.width ?? 'auto', props.height ?? 'auto']);
</script>

<style scoped></style>
